<?php
class Lib_Profiler {
    static $startTime;
    static function getTime(){
        $time = microtime();
        $time = explode(' ', $time);
        return $time[0]+$time[1];
    }
    
    static function start(){
        Lib_Profiler::$startTime = Lib_Profiler::getTime();
    }
    
    static function end($module=''){
        $finish = Lib_Profiler::getTime();
        $elapsedTime = round(($finish-Lib_Profiler::$startTime),4);
        echo 'Time elapse '.$module.' : '.$elapsedTime.' seconds';
    }
}
?>
